
use crate::{prisma::{self, meeting}};

use super::{utils::LibraryRequest, RouterBuilder};

pub(crate) fn mount() -> RouterBuilder {
    return RouterBuilder::new()
        .library_query("get", |t| {
            t(|_, _:(), library| async move {
                let mettings = library.db
                    .meeting()
                    .find_many(vec![
                        meeting::status::equals(Some("2".to_string()))
                    ])
                    .exec()
                    .await?;

                let opinions = library.db
                    .opinion()
                    .find_many(vec![])
                    .include(prisma::opinion::include!({ programme_book }))
                    .exec()
                    .await?;

                let configs = library.db
                    .config()
                    .find_many(vec![])
                    .exec()
                    .await?;

                let records = library.db
                    .record()
                    .find_many(vec![])
                    .exec()
                    .await?;

                Ok((mettings, opinions, configs, records))
			})
        });
}
